UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8zu4kqUr8xWzV+cdiufPbOguvpQNYHjAyxi6hKbsINA=' 
WHERE 
  key_id = 'eb39ad1d735e92374ed1d2425db64d638cf28419b7665be5fcaa58423ec1666a' 
  AND (
    token = '8zu4kqUr8xWzV+cdiufPbOguvpQNYHjAyxi6hKbsINA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049