UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ekrLp/yOwMolARyI0+JyqJ7BejRAXVqRjVcsn3i5KTE=' 
WHERE 
  key_id = '0f61f5e9dac5827fc94479a2a3e84d1f3f634616aacb35a0f61ac95cc8431147' 
  AND (
    token = 'ekrLp/yOwMolARyI0+JyqJ7BejRAXVqRjVcsn3i5KTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029